﻿@model List<Popw.LiveBlog.Models.ContentItem>
@{
	ViewBag.Title = "Live Blog";
}
@section HeaderContent {
	<script type="text/javascript">
		$(function () {
			LiveBlog.listen();
		});
	</script>
}

<div id="Stream">

	@foreach (var item in Model)
	{
		<div class="item" data-contentitemid="@item.ContentItemID">
			@Html.Raw(item.Content)
			<div class="stat">@item.Name - <span class="postTime" data-utc="@item.Utc">@item.FormattedTime</span> - [<a href="/Home/Item/@item.ContentItemID">link</a>]</div>
			@if (User.Identity.IsAuthenticated)
			{
				using (Html.BeginForm("Delete", "Admin", new { id = item.ContentItemID }, FormMethod.Post, null))
				{ <input type="submit" value="Delete" /> }
			}
		</div>
	}
</div>

<div id="StreamBottom"> </div>

<div class="item hide" id="ContentTemplate" data-contentitemid="">
	<span class="content"></span>
	<div class="stat"><span class="name"></span> - <span class="postTime" data-utc=""></span> - [<a href="">link</a>]</div>
	@if (User.Identity.IsAuthenticated)
	{
		<form action="" method="post"> <input type="submit" value="Delete"> </form>
	}
</div>

@Html.Hidden("OldestID", ((int)ViewBag.OldestID).ToString())